﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Tic4a00
    {
		private string _ticno;
		private string _comster;
		private double _ticamt;
        private DateTime? _createdate;
        private DateTime? _planpaydate;
        private DateTime? _paydate;
		private string _status;
		private string _muser;
		private string _listid;
		private string _sellerid;
		private string _comcode;
		private string _usercode;
		
        /// <summary>
        /// 税票号码
        /// </summary>
		public string Ticno
		{
			get { return _ticno;	 }
			set { _ticno=value;	}
		}
        /// <summary>
        /// 客户代码
        /// </summary>
		public string Comster
		{
			get { return _comster;	 }
			set { _comster=value;	}
		}
        /// <summary>
        /// 开票总额
        /// </summary>
		public double Ticamt
		{
			get { return _ticamt;	 }
			set { _ticamt=value;	}
		}
        /// <summary>
        /// 开票日期
        /// </summary>
		public DateTime? Createdate
		{
			get { return _createdate;	 }
			set { _createdate=value;	}
		}
        /// <summary>
        /// 预计付款日期
        /// </summary>
		public DateTime? Planpaydate
		{
			get { return _planpaydate;	 }
			set { _planpaydate=value;	}
		}
        /// <summary>
        /// 实际付款日期
        /// </summary>
		public DateTime? Paydate
		{
			get { return _paydate;	 }
			set { _paydate=value;	}
		}
        /// <summary>
        /// 状态
        /// </summary>
		public string Status
		{
			get { return _status;	 }
			set { _status=value;	}
		}
        /// <summary>
        /// 操作人
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Sellerid
		{
			get { return _sellerid;	 }
			set { _sellerid=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Comcode
		{
			get { return _comcode;	 }
			set { _comcode=value;	}
		}
        /// <summary>
        /// 
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
		
		public static List<Tic4a00> GetTic4a00ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Tic4a00> list = new List<Tic4a00>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Tic4a00 model = GetTic4a00ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Tic4a00 GetTic4a00ByDataRow(DataRow dr)
		{
			Tic4a00 model = new Tic4a00(); //实例化Tic4a00
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("ticno")&&!(dr["ticno"] is System.DBNull))  
				model.Ticno = ( string)dr["ticno"];
			if (dcc.Contains("comster")&&!(dr["comster"] is System.DBNull))  
				model.Comster = ( string)dr["comster"];
			if (dcc.Contains("ticamt")&&!(dr["ticamt"] is System.DBNull))  
				model.Ticamt = Convert.ToDouble(dr["ticamt"]);
			if (dcc.Contains("createdate")&&!(dr["createdate"] is System.DBNull))  
				model.Createdate = ( DateTime)dr["createdate"];
			if (dcc.Contains("planpaydate")&&!(dr["planpaydate"] is System.DBNull))  
				model.Planpaydate = ( DateTime)dr["planpaydate"];
			if (dcc.Contains("paydate")&&!(dr["paydate"] is System.DBNull))  
				model.Paydate = ( DateTime)dr["paydate"];
			if (dcc.Contains("status")&&!(dr["status"] is System.DBNull))  
				model.Status = ( string)dr["status"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			if (dcc.Contains("sellerid")&&!(dr["sellerid"] is System.DBNull))  
				model.Sellerid = ( string)dr["sellerid"];
			if (dcc.Contains("comcode")&&!(dr["comcode"] is System.DBNull))  
				model.Comcode = ( string)dr["comcode"];
			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			
			return model;
		}
    }
}
